-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(feedback): Replace react-virtualized
with @tanstack/react-virtual
in Feedback
#95398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(feedback): Replace react-virtualized
with @tanstack/react-virtual
in Feedback
#95398
Conversation
75f9749
to
b6c6c3a
Compare
flex-grow: 1; | ||
min-height: 300px; | ||
padding-bottom: ${space(0.5)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const Centered = styled('div')` | ||
justify-self: center; | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position: relative; | ||
top: 50%; | ||
transform: translateY(-50%); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`@tanstack/react-virtual` in Feedback
b6c6c3a
to
e35a094
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Duplicate Items in UI After Data Processing Change
The loadedRows
array, built from data.pages.flatMap(d => d[0])
, no longer de-duplicates items. This re-introduces duplicate entries in the UI when the API returns the same item across multiple pages (a scenario previously handled by uniqueItems
). Consequently, users see repeated list items and experience inconsistent selection behavior, as the underlying selection logic still uses a de-duplicated list.
static/app/components/infiniteList/infiniteListItems.tsx#L40-L52
sentry/static/app/components/infiniteList/infiniteListItems.tsx
Lines 40 to 52 in 87bfa47
overscan, | |
queryResult, | |
}: Props<Data>) { | |
const {data, hasNextPage, isFetchingNextPage, fetchNextPage} = queryResult; | |
const loadedRows = data ? data.pages.flatMap(d => d[0]) : []; | |
const parentRef = useRef<HTMLDivElement>(null); | |
const rowVirtualizer = useVirtualizer({ | |
count: hasNextPage ? loadedRows.length + 1 : loadedRows.length, | |
getScrollElement: () => parentRef.current, | |
estimateSize: estimateSize ?? (() => 100), | |
overscan: overscan ?? 5, | |
}); |
Was this report helpful? Give feedback by reacting with 👍 or 👎
The list still looks the same, this was surprisingly easy actually.
2 helper files i pulled in from sentry-toolbar (InfiniteListItems, InfiniteListState) made it easier too, they wrap a bunch of state conditions and also wrap the load-more triggers which really cleanup this
<FeedbackList>
component now.Related to https://github.com/getsentry/frontend-tsc/issues/91